<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/common/taglibs.jsp"%>
<%@include file="/common/repairAddress.jsp" %>
<!DOCTYPE html>
<html>
<head>
<title>小修项目--${fns:getConfig('productName')}</title>
<%@include file="/common/uihead.jsp" %>
<style type="text/css">
input#runDate{
   padding-right:10px; 
   background:url("${ctx}/images/8.png") no-repeat scroll right center transparent; 
}
</style>
<%@ include file="/common/jqGridHead.jsp"%>
</head>
<body>
	<ul class="nav nav-tabs" style="margin:0 4px 4px 4px;">
		<c:forEach items="${list}" var="menu"  varStatus="idxStatus">
			<li class="${menu.tag eq tag?'active':''}">
				<a href="${ctx}/${menu.href}${fn:indexOf(menuChild.href, '?') eq -1?'?':'&'}left=${fns:encodeParamUrl(left)}&top=${fns:encodeParamUrl(top)}&parentId=${fns:encodeParamUrl(parentId)}&LId=${fns:encodeParamUrl(LId)}&filter_EQS_tag=${menu.tag}">
					<i class="icon icon-list" style="margin-right:10px"></i><span>${menu.name}</span>
				</a>
			</li>
		</c:forEach>
	</ul>
    <tags:message content="${msg}" />
<form id="mainForm" class="form-horizontal" role="form" method="get"  name="mainForm">
<div class="breadcrumb form-search" style="background-color: #f5f5f5;">
			<div>
				<label>关键字:</label>
				<input type="text" oninput="queryForGrid('mainForm','jqGrid')" onporpertychange="queryForGrid('mainForm','jqGrid')"  name="filter_LIKES_projectName_OR_roadName_OR_maintainOrg" value="${filter_LIKES_projectName_OR_roadName_OR_maintainOrg}" placeholder="小修项目关键信息" />
			</div>
		</div>
  <table id="jqGrid"></table>
  <div id="jqGridPager"></div> 
</form>
	<script type="text/javascript">
	    var path = "${ctx}";
	    var tag = "${tag}";
		$(document).ready(function()
		{
			var jqgridH = $(window).height()-335;
			$("#jqGrid").jqGrid(
			{ url : '${ctx}/roadRepair/list.do',
			  mtype : "GET",
			  datatype : "json",
			  page : 1,
			  viewrecords: true,
			  colModel:[{
					label: '操作',
					align:'center',
					width:100,
				    name: 'rrId',
				    formatter: function (cellValue, options, rowObject){
				    	var applyUrl="${repairAddress}/rep/roadrepairapply!input.action?hd=0&type=1&num=0&roadRepairID="+cellValue;
				    	var acceptUrl ="${repairAddress}/rep/roadrepairaccept!getRepairAccept.action?flag=1&num=1&roadRepairID="+cellValue;
				      	return "<a href='"+applyUrl+"' target='_blank' title='申报表'><i class='icon-eye' style='margin-top:2px;'></i>&nbsp;查看</a>";
				       }
				    },{
           	        label: '项目名称',
           	        name: 'projectName',
           	     	align:'center',
           	        width: 175
                },{
    	            label: '设施名称',
    	            name: 'roadName',
    	            align:'center',
    	            width: 140
                },
                { label:'开始时间', name: 'beginDate',align:'center', width: 100},
                { label:'结束时间', name: 'endDate',align:'center', width: 100},
                { label:'维修措施', name: 'projectService',align:'center', width: 150,
                 formatter:function(cellValue){
                		if(cellValue!=null&&cellValue!=""){
                			var str = "\n";
               			    cellValue = cellValue.replace(new RegExp(str,"g"), " ");
                		}else{
                			cellValue = "";
                		}
                		return cellValue;
                    }
                },{label: '项目位置',name: 'projectLocation',align:'center',width: 175},
//                 { label: '养护标段',name: 'mainDistrict',align:'center', width: 100 }, 
                { label:'区', name: 'district', align:'center',
                formatter:function(cellValue){
                	return Pengtu.buildCodeName(2050,cellValue);
                },width: 100 },
                { label:'街道', name: 'subdistrict',align:'center', width: 100 },
                {label: '是否抢险工程',name: 'emergency',align:'center',width: 100,
                	formatter:function(cellValue){
                		return Pengtu.buildCodeName(1000,cellValue);
                	}
                },
                {label: '项目编号',name: 'projectNumber',align:'center',width: 100
                },
                { label:'管养单位', name: 'manageOrg', align:'center',width: 100 },
                { label:'养护单位', name: 'maintainOrg',align:'center', width: 180},
                { label:'项目概括', name: 'projectPoint',align:'center', width: 150,
                	formatter:function(cellValue){
                		return iGetInnerText(cellValue);
                	}},
                { label:'项目申请金额', name: 'projectApplyCost', align:'center',width: 100 },
                { label:'项目总金额', name: 'projectCost',align:'center', width: 100 },
                { label:'资金来源', name: 'maintainSource',align:'center', width: 100 ,
                	formatter:function(cellValue){
                		return Pengtu.buildCodeName(2002,cellValue);
                	}
                },
                { label: '工程状态', name: 'status',align:'center', width: 100 ,
                	formatter:function(cellValue){
                		
                    	return Pengtu.buildCodeName(2017,cellValue);
                    	}		
                },
                { label:'备注',
                	name: 'remark',
                	align:'center',
                	width: 100,
                	formatter:function(cellValue){
                		if(cellValue != null&&cellValue!=""){
            			var str = "\n";
            			 cellValue = cellValue.replace(new RegExp(str,"g"), " ");
                		}else{
                			cellValue = "";
                		}
            		 return cellValue;
            	}
                	}
						],
			autowidth : false,width:$(window).width()-248, height : jqgridH,scrollOffset:0, shrinkToFit : 400, rowNum : 10, viewrecords : true, rownumbers : true,
			jsonReader:{
    			root: "result",
    			page: "currentPage",
    			total: "totalPages",
    			records: "totalCount",
    			repeatitems: true,
    			cell: "cell",
    			id: "id",
    			userdata: "userdata",
    			subgrid: {root:"results", repeatitems: true, cell:"cell"}
    		},
    		prmNames: {
				page:"pageNo",
				rows:"pageSize",
				sort: "orderBy",
				order: "order",
				search:"_search",
				nd:"nd", id:"id",
				oper:"oper",
				editoper:"edit",
				addoper:"add",
				deloper:"del",
				subgridid:"id",
				npage: null,
				totalrows:"totalCounts"
			}, 
			rowList :[10,20,30], 
			pager : "#jqGridPager"
			});
		});
</script>
</body>
</html>